package com.sikao.app.ui;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.cnzhizi.wheelpop.model.OneModel;
import com.cnzhizi.wheelpop.ui.SkmModiPopup;
import com.sikao.app.R;
import com.sikao.app.adapter.AddInviteStepTwoTypeFiveItemAdapter;
import com.sikao.app.adapter.AddInviteStepTwoTypeFourItemAdapter;
import com.sikao.app.adapter.AddInviteStepTwoTypeOneItemAdapter;
import com.sikao.app.adapter.AddInviteStepTwoTypeThreeItemAdapter;
import com.sikao.app.adapter.GvAddStepPricesTypeProfilePicItemAdapter;
import com.sikao.app.bean.AddInviteTwoSubmitBean;
import com.sikao.app.bean.Bean;
import com.sikao.app.bean.CategoryAttrForInviteBean;
import com.sikao.app.bean.ReadAddInviteStepTwoSubmitBean;
import com.sikao.app.dao.AddInviteTwoModel;
import com.sikao.app.dao.CategoryAttrForInviteModel;
import com.sikao.app.myinterface.Callback;
import com.sikao.app.net.OnNetBackListener;
import com.sikao.app.ui.base.BaseActivity;
import com.sikao.app.utils.JSONUtil;
import com.sikao.app.utils.Utils;
import com.sikao.app.view.MyGridView;
import com.sikao.app.view.MyListView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Sun on 2016/8/19.
 * [72]发布招标[step-2]  属性类型 1文本 2多行文本 3单选 4多选 5下拉 6文件
 */
public class AddInviteTwoActivity extends BaseActivity implements View.OnClickListener {

	private TextView titleTv;
	private TextView title_right_tv;
	private ImageView backIv;

	private MyListView addInviteStepTwoTypeOne;
	private MyListView addInviteStepTwoTypeThree;
	private MyListView addInviteStepTwoTypeFour;
	private MyListView addInviteStepTwoTypeFive;
	private MyGridView gvAddStepPricesTypeProfilePic;

	AddInviteTwoSubmitBean addInviteTwoSubmitBean = new AddInviteTwoSubmitBean();


	public static final int REQUEST_GET_PHOTO = 1001;
	int addTo;
	String catId;//分类ID
	String inviteId;//招标ID
	private String inviteStatus = "";
	public static boolean canEditForInvite = true;
	CategoryAttrForInviteBean categoryAttrBean;//商品分类属性
	AddInviteStepTwoTypeOneItemAdapter addInviteStepTwoTypeOneItemAdapter;//文本的适配器
	AddInviteStepTwoTypeThreeItemAdapter addInviteStepTwoTypeThreeItemAdapter;//单选的适配器 嵌套
	AddInviteStepTwoTypeFourItemAdapter addInviteStepTwoTypeFourItemAdapter;//多选的适配器 嵌套
	AddInviteStepTwoTypeFiveItemAdapter addInviteStepTwoTypeFiveItemAdapter;//下拉的适配器 嵌套

	GvAddStepPricesTypeProfilePicItemAdapter gvAddStepPricesTypeProfilePicItemAdapter;//货物图样适配器

	public static boolean initFlagTypeThree = false;//用于标识处理默认是否已经成功执行过一次 单选的赋值默认
	public static boolean initFlagTypeFour = false;//用于标识处理默认是否已经成功执行过一次 多选的赋值默认

	public static List<CategoryAttrForInviteBean.ResBean> resTypeOne = new ArrayList<>();//1文本
	public static List<CategoryAttrForInviteBean.ResBean> resTypeThree = new ArrayList<>();//3单选
	public static List<CategoryAttrForInviteBean.ResBean> resTypeFour = new ArrayList<>();//4多选
	public static List<CategoryAttrForInviteBean.ResBean> resTypeFive = new ArrayList<>();//5下拉

	private List<String> profilePicList = new ArrayList<String>();//货物图样
	int picIndex = 0;//点击的图片的下标
	int releaseInviteState = 1;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		setContentView(R.layout.activity_add_invite_step_two);
		super.onCreate(savedInstanceState);

	}

	@Override
	protected void initData() {
		 /*
        (招标的状态inviteStatus)status:0.1不可编辑; status:-1.2可编辑 ;这是发布招标那边的  3是第一次发布进入的
          新增状态 -1准备资料0待审核 1通过 2审核失败3下架4售空
              0,1,3,4 不可编辑
         */
		Intent intent = getIntent();
		addTo = 1; //招标展示的形态和拍卖是一样的  intent.getIntExtra("addTo", 0);//addTo":[{"id":0,"value":"商城"},{"id":1,"value":"拍卖"},{"id":2,"value":"定向单"}]
		catId = intent.getStringExtra("catId");
		inviteId = intent.getStringExtra("inviteId");
		releaseInviteState = intent.getIntExtra("releaseInviteState", 1);
		inviteStatus = intent.getStringExtra("inviteStatus");

		if ("0".equals(inviteStatus) || "1".equals(inviteStatus) || "3".equals(inviteStatus) || "4".equals(inviteStatus)) {
			canEditForInvite = false;
		} else if ("-1".equals(inviteStatus) || "2".equals(inviteStatus)) {
			canEditForInvite = true;
		} else if ("3".equals(releaseInviteState)) {
			canEditForInvite = true;
		}
		Utils.showLog("=======inviteId:" + inviteId);
		//清空值
		categoryAttrBean = null;
		resTypeOne.clear();
		resTypeThree.clear();
		resTypeFour.clear();
		resTypeFive.clear();
		initFlagTypeThree = false;//用于标识处理默认是否已经成功执行过一次 单选的赋值默认
		initFlagTypeFour = false;//用于标识处理默认是否已经成功执行过一次 多选的赋值默认

	}

	private void initDealData() {
		List<CategoryAttrForInviteBean.ResBean> resList = categoryAttrBean.getRes();
		if (addTo != 1) {
			for (CategoryAttrForInviteBean.ResBean rb : resList) {
				if ("1".equals(rb.getAttr_type())) {
					resTypeOne.add(rb);
				} else if ("3".equals(rb.getAttr_type())) {
					resTypeThree.add(rb);
				} else if ("4".equals(rb.getAttr_type())) {
					resTypeFour.add(rb);
				} else if ("5".equals(rb.getAttr_type())) {
					resTypeFive.add(rb);
				}
			}
		} else {//如果是拍卖 单选变下拉
			for (CategoryAttrForInviteBean.ResBean rb : resList) {
				if ("1".equals(rb.getAttr_type())) {
					resTypeOne.add(rb);
				} else if ("4".equals(rb.getAttr_type())) {
					resTypeFour.add(rb);
				} else if ("5".equals(rb.getAttr_type()) || "3".equals(rb.getAttr_type())) {
					resTypeFive.add(rb);
				}
			}
		}
	}

	@Override
	protected void initView() {
		titleTv = (TextView) findViewById(R.id.title_middle_tv);
		title_right_tv = (TextView) findViewById(R.id.title_right_tv);

		addInviteStepTwoTypeOne = (MyListView) findViewById(R.id.mll_add_step_prices_type_one);
		addInviteStepTwoTypeThree = (MyListView) findViewById(R.id.mll_add_step_prices_type_three);
		addInviteStepTwoTypeFour = (MyListView) findViewById(R.id.mll_add_step_prices_type_four);
		addInviteStepTwoTypeFive = (MyListView) findViewById(R.id.mll_add_step_prices_type_five);
		gvAddStepPricesTypeProfilePic = (MyGridView) findViewById(R.id.gv_add_step_prices_type_profile_pic);
		backIv = (ImageView) findViewById(R.id.title_left_img);
		//服务器获取信息

		new CategoryAttrForInviteModel(this, new OnNetBackListener<CategoryAttrForInviteBean>() {
			@Override
			public void netBack(CategoryAttrForInviteBean data) {
				if (data == null) {
					Toast.makeText(AddInviteTwoActivity.this, data.getMsg(), Toast.LENGTH_SHORT).show();
				} else {
					if (data.getStatus() == 1) {
						categoryAttrBean = data;
						initDealData();
						initViewData();
					} else {
						Toast.makeText(AddInviteTwoActivity.this, data.getMsg(), Toast.LENGTH_SHORT).show();
					}
				}
			}
		}).request(JSONUtil.toJSON(new ReadAddInviteStepTwoSubmitBean(inviteId)), true);//.request(JSONUtil.toJSON(new CategoryAttrSubmitBean(catId)), true);

      /*模拟开始*/
     /*   String resultStr="{\"status\":1,\"msg\":\"成功进行操作\",\"res\":[{\"id\":\"1\",\"name\":\"包装方式\",\"attr_type\":\"1\",\"attr_values\":[{\"id\":0,\"value\":\"散装\"}],\"default_value\":[{\"id\":0,\"value\":\"散装\"}],\"is_filter\":\"0\",\"status\":\"0\"},{\"id\":\"2\",\"name\":\"含水量\",\"attr_type\":\"3\",\"attr_values\":[{\"id\":0,\"value\":\"5%\"},{\"id\":1,\"value\":\"7%\"},{\"id\":2,\"value\":\"10%\"},{\"id\":3,\"value\":\"15%\"},{\"id\":4,\"value\":\"20%\"}],\"default_value\":[{\"id\":1,\"value\":\"7%\"}],\"is_filter\":\"0\",\"status\":\"0\"},{\"id\":\"3\",\"name\":\"煤燃烧值\",\"attr_type\":\"3\",\"attr_values\":[{\"id\":0,\"value\":\"10000大卡\"},{\"id\":1,\"value\":\"7000大卡\"},{\"id\":2,\"value\":\"5000大卡\"},{\"id\":3,\"value\":\"3000大卡\"},{\"id\":4,\"value\":\"1000大卡\"}],\"default_value\":[{\"id\":2,\"value\":\"5000大卡\"}],\"is_filter\":\"0\",\"status\":\"0\"},{\"id\":\"7\",\"name\":\"多选测试\",\"attr_type\":\"4\",\"attr_values\":[{\"id\":0,\"value\":\"多选测试1\"},{\"id\":1,\"value\":\"多选测试2\"},{\"id\":2,\"value\":\"多选测试3\"},{\"id\":3,\"value\":\"多选测试4\"},{\"id\":4,\"value\":\"多选测试5\"},{\"id\":5,\"value\":\"多选测试6\"},{\"id\":6,\"value\":\"多选测试7\"}],\"default_value\":[{\"id\":0,\"value\":\"多选测试1\"},{\"id\":1,\"value\":\"多选测试2\"}],\"is_filter\":\"0\",\"status\":\"0\"},{\"id\":\"8\",\"name\":\"下拉测试\",\"attr_type\":\"5\",\"attr_values\":[{\"id\":0,\"value\":\"下拉测试1\"},{\"id\":1,\"value\":\"下拉测试2\"},{\"id\":2,\"value\":\"下拉测试3\"}],\"default_value\":[{\"id\":2,\"value\":\"下拉测试3\"}],\"is_filter\":\"0\",\"status\":\"0\"},{\"id\":\"9\",\"name\":\"文本测试\",\"attr_type\":\"1\",\"attr_values\":[{\"id\":0,\"value\":\"\"}],\"default_value\":[{\"id\":0,\"value\":\"\"}],\"is_filter\":\"0\",\"status\":\"0\"}]}";
        Gson mGson=new Gson();
        Object obj = mGson.fromJson(resultStr, new BaseCallback<CategoryAttrForInviteBean>(){

            @Override
            public void onBeforeRequest(Request request) {

            }

            @Override
            public void onFailure(Request request, Exception e) {

            }

            @Override
            public void onResponse(Response response) {

            }

            @Override
            public void onSuccess(Response response, CategoryAttrForInviteBean categoryAttrBean) {

            }

            @Override
            public void onError(Response response, int code, Exception e) {

            }

            @Override
            public void dismissDialog() {

            }
        } .mType);

        categoryAttrBean=(CategoryAttrForInviteBean)obj;
        initDealData();
        initViewData();*/
       /*模拟结束*/
	}


	private void initViewData() {
		//adapter 设置
		//文本的
		addInviteStepTwoTypeOneItemAdapter = new AddInviteStepTwoTypeOneItemAdapter(this, resTypeOne);
		addInviteStepTwoTypeOne.setAdapter(addInviteStepTwoTypeOneItemAdapter);
		if (resTypeOne.size()<=0){
			addInviteStepTwoTypeOne.setVisibility(View.GONE);
		}else{
			addInviteStepTwoTypeOne.setVisibility(View.VISIBLE);
		}

		//单选的
		addInviteStepTwoTypeThreeItemAdapter = new AddInviteStepTwoTypeThreeItemAdapter(this, resTypeThree);
		addInviteStepTwoTypeThree.setAdapter(addInviteStepTwoTypeThreeItemAdapter);
		if (resTypeThree.size()<=0){
			addInviteStepTwoTypeThree.setVisibility(View.GONE);
		}else{
			addInviteStepTwoTypeThree.setVisibility(View.VISIBLE);
		}
		//多选的
		addInviteStepTwoTypeFourItemAdapter = new AddInviteStepTwoTypeFourItemAdapter(this, resTypeFour);
		addInviteStepTwoTypeFour.setAdapter(addInviteStepTwoTypeFourItemAdapter);
		if (resTypeFour.size()<=0){
			addInviteStepTwoTypeFour.setVisibility(View.GONE);
		}else{
			addInviteStepTwoTypeFour.setVisibility(View.VISIBLE);
		}
		//下拉的

		//给下拉赋值默认值 cont 默认显示第一个
		for (int i = 0; i < resTypeFive.size(); i++) {
			if (resTypeFive.get(i).getDefault_value().size() > 0) {
				resTypeFive.get(i).setContent(resTypeFive.get(i).getDefault_value().get(0).getValue());
				//更新提交参数中修改的这个参数
				for (int j = 0; j < resTypeFive.get(i).getAttr_values().size(); j++) {
					if (resTypeFive.get(i).getAttr_values().get(j).getId() == resTypeFive.get(i).getDefault_value().get(0).getId()) {
						resTypeFive.get(i).getAttr_values().get(j).setChecked(true);//此项目被选中
					}
				}
			} else {//不存在默认值，则显示第一个的值
				resTypeFive.get(i).setContent(resTypeFive.get(i).getAttr_values().get(0).getValue());
				//更新提交参数中修改的这个参数
				resTypeFive.get(i).getAttr_values().get(0).setChecked(true);//此项目被选中
			}
		}

		addInviteStepTwoTypeFiveItemAdapter = new AddInviteStepTwoTypeFiveItemAdapter(this, resTypeFive, addInviteStepTwoTypeFiveItemAdapterOnClickListener);
		addInviteStepTwoTypeFive.setAdapter(addInviteStepTwoTypeFiveItemAdapter);

		if (resTypeFive.size()<=0){
			addInviteStepTwoTypeFive.setVisibility(View.GONE);
		}else{
			addInviteStepTwoTypeFive.setVisibility(View.VISIBLE);
		}

		//货物图样
		profilePicList.add("");//刚进去默认有一张图片

		gvAddStepPricesTypeProfilePicItemAdapter = new GvAddStepPricesTypeProfilePicItemAdapter(this, profilePicList, new Callback() {
			@Override
			public void notice(int position) {
				picIndex = position;
				if (position == (profilePicList.size() - 1)) {//第一次点击或者点的是最后一个


					Intent intent = new Intent(AddInviteTwoActivity.this, SelectPictureActivity.class);
					startActivityForResult(intent, REQUEST_GET_PHOTO);
					overridePendingTransition(R.anim.bottom_push_in, R.anim.bottom_push_out);

				} else {
					createDialog(position);
				}
			}
		});
		gvAddStepPricesTypeProfilePic.setAdapter(gvAddStepPricesTypeProfilePicItemAdapter);

	}

	@Override
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		if (resultCode == RESULT_OK) {
			switch (requestCode) {
				case REQUEST_GET_PHOTO:
					String picturePath = data.getStringExtra("path");
					profilePicList.set(picIndex, picturePath);
					//添加一个新的空的照片
					profilePicList.add("");
					gvAddStepPricesTypeProfilePicItemAdapter.notifyDataSetChanged();
					break;
				default:
					break;
			}
		}
	}

	private void createDialog(final int position) {
		AlertDialog dialog;
		AlertDialog.Builder builder = new AlertDialog.Builder(this);
		builder.setMessage("确认删除吗?");
		builder.setPositiveButton("确认", new DialogInterface.OnClickListener() {
			@Override
			public void onClick(DialogInterface dialog, int which) {
				dialog.dismiss();
				profilePicList.remove(position);
				gvAddStepPricesTypeProfilePicItemAdapter.notifyDataSetChanged();

			}
		});
		builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
			@Override
			public void onClick(DialogInterface dialog, int which) {
				dialog.dismiss();
			}
		});
		dialog = builder.create();
		dialog.show();
	}

	@Override
	protected void initListener() {
		title_right_tv.setOnClickListener(this);
		backIv.setOnClickListener(this);
	}

	@Override
	protected void init() {
		titleTv.setText("附加信息");
		backIv.setVisibility(View.VISIBLE);

		title_right_tv.setText("保存并发布");
		if (canEditForInvite) {
			title_right_tv.setVisibility(View.VISIBLE);
		} else {
			title_right_tv.setVisibility(View.GONE);
		}
	}

	@Override
	public void onBackPressed() {
		finishForBack();
	}

	private void finishForBack() {
		Intent intent = new Intent();
		intent.putExtra("catId", catId);
		intent.putExtra("inviteId", inviteId);
		intent.putExtra("releaseInviteState", releaseInviteState);
		setResult(ReleaseGoodsActivity.STEP_TWO_RESULT_CODE, intent);
		Utils.showLog("===返回编辑的时候提交的releaseInviteState：" + releaseInviteState);
		finish();

	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
			case R.id.title_left_img:
				finishForBack();
				break;
			case R.id.title_left_tv:
				finishForBack();
				break;
			case R.id.title_right_tv://下一步
				getPickData();
				//打印一下
				for (AddInviteTwoSubmitBean.AttrValueBean avb : addInviteTwoSubmitBean.getAttrValue()) {
					Utils.showLog("=====" + avb.getAttrId() + " " + avb.getValue() + " " + avb.getChangePrice());
				}

               /* //测试退出 直接跳转到卖家中心
                AppManager appManager =AppManager.getAppManager();

                appManager.toSeller();*/

				addInviteTwoSubmitBean.setInviteId(inviteId);
				new AddInviteTwoModel(this, new OnNetBackListener<Bean>() {
					@Override
					public void netBack(Bean data) {
						if (data == null) {
							Toast.makeText(AddInviteTwoActivity.this, data.getMsg(), Toast.LENGTH_SHORT).show();
						} else {
							if ("1".equals(data.getStatus())) {//正确添加 附加信息 发表招标成功
                               /* Intent intent = new Intent();
                                intent.setClass(AddInviteTwoActivity.this, AddGoodsStepThreeActivity.class);
                                intent.putExtra("objectId",inviteId);
                                startActivity(intent);
*/
								Toast.makeText(AddInviteTwoActivity.this, data.getMsg(), Toast.LENGTH_SHORT).show();
								ReleaseTenderActivity.releaseTenderActivity.finish();
								finish();

							} else {
								Toast.makeText(AddInviteTwoActivity.this, data.getMsg(), Toast.LENGTH_SHORT).show();
							}
						}
					}
				}).request(JSONUtil.toJSON(addInviteTwoSubmitBean), true);

				break;
			default:
				break;
		}
	}

	/**
	 * 获取选中的值，赋值到submitBean中
	 */
	private void getPickData() {
		addInviteTwoSubmitBean.getAttrValue().clear();//充值


		for (CategoryAttrForInviteBean.ResBean rb : resTypeOne) {
			for (CategoryAttrForInviteBean.ResBean.AttrValuesBean avb : rb.getAttr_values()) {
				//  if (avb.isChecked()) {
				Utils.showLog("=====avbresTypeOne:" + avb.getId() + " " + avb.getValue() + "  " + avb.getChangePrice());
				AddInviteTwoSubmitBean.AttrValueBean avbForSubmit = new AddInviteTwoSubmitBean.AttrValueBean();
				avbForSubmit.setAttrId(rb.getId());
				avbForSubmit.setValue(avb.getValue());
				avbForSubmit.setChangePrice(avb.getChangePrice());
				addInviteTwoSubmitBean.getAttrValue().add(avbForSubmit);
				// }
			}
		}
		for (CategoryAttrForInviteBean.ResBean rb : resTypeThree) {
			for (CategoryAttrForInviteBean.ResBean.AttrValuesBean avb : rb.getAttr_values()) {
				if (avb.isChecked()) {
					Utils.showLog("=====avbresTypeThree:" + avb.getId() + " " + avb.getValue() + "  " + avb.getChangePrice());
					AddInviteTwoSubmitBean.AttrValueBean avbForSubmit = new AddInviteTwoSubmitBean.AttrValueBean();
					avbForSubmit.setAttrId(rb.getId());
					avbForSubmit.setValue(avb.getValue());
					avbForSubmit.setChangePrice(avb.getChangePrice());
					addInviteTwoSubmitBean.getAttrValue().add(avbForSubmit);
				}
			}
		}
		for (CategoryAttrForInviteBean.ResBean rb : resTypeFour) {
			for (CategoryAttrForInviteBean.ResBean.AttrValuesBean avb : rb.getAttr_values()) {
				if (avb.isChecked()) {
					Utils.showLog("=====avbresTypeFour:" + avb.getId() + " " + avb.getValue() + "  " + avb.getChangePrice());
					AddInviteTwoSubmitBean.AttrValueBean avbForSubmit = new AddInviteTwoSubmitBean.AttrValueBean();
					avbForSubmit.setAttrId(rb.getId());
					avbForSubmit.setValue(avb.getValue());
					avbForSubmit.setChangePrice(avb.getChangePrice());
					addInviteTwoSubmitBean.getAttrValue().add(avbForSubmit);
				}
			}
		}
		for (CategoryAttrForInviteBean.ResBean rb : resTypeFive) {
			for (CategoryAttrForInviteBean.ResBean.AttrValuesBean avb : rb.getAttr_values()) {
				if (avb.isChecked()) {
					Utils.showLog("=====avbresTypeFive:" + avb.getId() + " " + avb.getValue() + "  " + avb.getChangePrice());
					AddInviteTwoSubmitBean.AttrValueBean avbForSubmit = new AddInviteTwoSubmitBean.AttrValueBean();
					avbForSubmit.setAttrId(rb.getId());
					avbForSubmit.setValue(avb.getValue());
					avbForSubmit.setChangePrice(avb.getChangePrice());
					addInviteTwoSubmitBean.getAttrValue().add(avbForSubmit);
				}
			}
		}
	}

	final List<OneModel> oneModelList = new ArrayList<OneModel>();//滚轮一级
	public SkmModiPopup skmModiPopup;
	int positionItem = 0;//选择的第几条附加值

	private void showPop() {
		skmModiPopup = new SkmModiPopup(this, skmPopOnClickListener, oneModelList, "选择", 1, null);
		skmModiPopup.showAtLocation(findViewById(R.id.rl_release_goods_step_two),
				Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 0);
	}

	public SkmModiPopup.SkmPopOnClickListener skmPopOnClickListener = new SkmModiPopup.SkmPopOnClickListener() {

		@Override
		public void myOnClick(int pOneCurrent, int pTwoCurrent, int pThreeCurrent, View v, View root) {
			skmModiPopup.dismiss();
			Utils.showLog("========SkmPopOnClickListener positionItem=" + positionItem + " pOneCurrent=" + pOneCurrent + " oneModelListForGoodsClassify.size" + oneModelList.size());

			//Toast.makeText(MallOrderActivity.this, getGoods_attrs.get(positionItem).getDefault_value().get(pOneCurrent) + "  " + getGoods_attrs.get(positionItem).getId(), Toast.LENGTH_SHORT).show();

			// 重置是否选中

			for (int i = 0; i < resTypeFive.get(positionItem).getAttr_values().size(); i++) {
				resTypeFive.get(positionItem).getAttr_values().get(i).setChecked(false);
			}

			//更新提交参数中修改的这个参数
			resTypeFive.get(positionItem).getAttr_values().get(pOneCurrent).setChecked(true);//此项目被选中


			//更改content值 这个字段 如果重新生成bean要重新写上去
			resTypeFive.get(positionItem).setContent(resTypeFive.get(positionItem).getAttr_values().get(pOneCurrent).getValue());

			addInviteStepTwoTypeFiveItemAdapter.notifyDataSetChanged();

		}
	};
	//adapter回调
	AddInviteStepTwoTypeFiveItemAdapter.AddInviteStepTwoTypeFiveItemAdapterOnClickListener addInviteStepTwoTypeFiveItemAdapterOnClickListener = new AddInviteStepTwoTypeFiveItemAdapter.AddInviteStepTwoTypeFiveItemAdapterOnClickListener() {
		@Override
		public void myOnClick(int position) {
			positionItem = position;
			oneModelList.clear();
			for (int i = 0; i < resTypeFive.get(positionItem).getAttr_values().size(); i++) {

				OneModel oneModel = new OneModel();
				oneModel.setId(resTypeFive.get(positionItem).getAttr_values().get(i).getId() + "");//属性的id
				oneModel.setName(resTypeFive.get(positionItem).getAttr_values().get(i).getValue());//属性的值
				oneModelList.add(oneModel);
			}
			showPop();
		}
	};
}
